Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show key icon for empty passwords #890

Merged
merged 12 commits into from
Jul 23, 2024

Conversation

graeme
Copy link
Contributor

@graeme graeme commented Jul 11, 2024

Please review the release process for BrowserServicesKit here.

Required:

Task/Issue URL: https://app.asana.com/0/1202926619870900/1207697076491402/f
iOS PR: duckduckgo/iOS#3070
macOS PR: duckduckgo/macos-browser#2962
What kind of version bump will this require?: Patch

Optional:

Tech Design URL: https://app.asana.com/0/481882893211075/1207750849382981

Description:

There has been an issue around for some time where the autofill key icon (indicating that there is autofill data for that field) was showing in the password field despite there being no password stored for a domain. This was because we were using the existence of any stored data for that domain as the source of truth for showing the icon in both username and password fields.

This PR fixes that bug by adding the ability to fetch the passwords themselves and check if they are non-empty.

Steps to test this PR:

See platform PRs

OS Testing:

  • iOS 14
  • iOS 15
  • iOS 16
  • macOS 10.15
  • macOS 11
  • macOS 12

Internal references:

Software Engineering Expectations
Technical Design Template

@graeme graeme self-assigned this Jul 11, 2024
@graeme graeme requested review from amddg44 and aataraxiaa July 11, 2024 15:40
Copy link
Contributor

@aataraxiaa aataraxiaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just did a first pass as this is still in draft @graeme. Left a couple of comments. I can have another look when it’s ready with a PR description etc.

}
}

private func decryptCredentials(_ credentials: SecureVaultModels.WebsiteCredentials) throws -> SecureVaultModels.WebsiteCredentials {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move this down to the // MARK: Private section

@graeme graeme marked this pull request as ready for review July 15, 2024 13:39
from: vault,
or: passwordManager,
withPartialMatches: includePartialAccountMatches) { [weak self] accounts, error in
getCredentials(forDomain: domain, from: vault, or: passwordManager) { [weak self] credentials, error in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@graeme there is a regression here since withPartialMatches: includePartialAccountMatches has not been implemented when replacing getAccounts with getCredentials which is what allows subdomain matching to work e.g.

  • if you have credentials saved for nytimes.com
  • you visit the website nytimes.com
  • when you click to login you are redirected to myaccount.nytimes.com
  • your nytimes.com credentials should be a suggestion since it’s the same TLD (nytimes.com)

@amddg44
Copy link
Contributor

amddg44 commented Jul 22, 2024

@graeme unfortunately I think that last change impacted the hasPassword functionality. I’ve tested on iOS & macOS and am seeing the key icon in the password field for both
image
image

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
version = "1.7">
version = "1.8">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might worth checking with the team before upgrading this (and SubscriptionTests.xcscheme below)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I'll revert before merging as this isn't really the place.

Copy link
Contributor

@amddg44 amddg44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I’ve tested deduplication, partial domain matching, localhost passwords, domains with ports as well as Bitwarden integration and everything behaved exactly as expected, nice work! 👏

@graeme graeme merged commit b2f5a71 into main Jul 23, 2024
7 checks passed
@graeme graeme deleted the graeme/passwords-tooltip-logic-bug branch July 23, 2024 15:18
samsymons added a commit that referenced this pull request Jul 25, 2024
* main:
  Moves evaluateJS methods to main thread (#908)
  Bumped C-S-S to 6.4.0 (#910)
  Don't show key icon for empty passwords (#890)
  Hotfix: fix index out-of-bounds in startAttachingCrashLogMessages (#906)
  Add support for additionalCampaignPixelParams (#899)
  Update breakage report locale to JSON format (#905)
  Add support for additionalCampaignPixelParams
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants